Skip to main content

IdP

The IdP Service is responsible for doing Identity Provider actions like user login, logout, pairing, ...

Details​

All of this data will be compliant with the Elevate Vikimap Model as defined in the models section

Available methods​

  • loginByCredentials(): Credentials Login Service
  • loginByPairingCode(): Pairing Code Login Service
  • validateUser(): Validade User Service
  • logout(): Logout Service
  • getPairingCode(): Pairing Code Service
  • forgotPassword(): Forgot Password Service
  • getProfile(): Profile management - get profile by id
  • getProfiles(): Profile management - get all profile
  • createProfile(): Profile management - add a new profile
  • updateProfileAvatar(): Profile management - update profile avatar by profile id
  • updateProfileName(): Profile management - update profile name by profile id
  • deleteProfile(): Profile management - delete profile by id
  • getAvatars(): Profile management - get all avatars
  • createPIN(): Profile management - setup a pin for the profile by profile id
  • updatePIN(): Profile management - update pin by profile id
  • deletePIN(): Profile management - remove pin by profile id

Associated Context​

The application includes an idP related Context: AuthContext that handle all the user related state and actions, so the Service shouldn't be used directly

Example usage​

import React, { useContext } from 'react';
[...]
import { AuthContext } from '#/context/AuthContext';
[...]
const authContext = useContext(AuthContext);
[...]
const { byCredentials } = authContext.login();
byCredentials(username, password).catch(() => {
[...]
});